﻿<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>lagou manage</title>
<meta name="description" content="拉勾数据">
<meta name="keywords" content="二手房 房产经济 房企 开发商 拉勾数据 IFS">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="icon" type="image/png" href="assets/i/favicon.png">
<link rel="apple-touch-icon-precomposed" href="assets/i/app-icon72x72@2x.png">
<meta name="apple-mobile-web-app-title" content="eosms for IFS" />
<link rel="stylesheet" href="assets/css/amazeui.min.css" />
<link rel="stylesheet" href="assets/css/admin.css">
</head>
<body>
<!--[if lte IE 9]>
<p class="browsehappy">你正在使用<strong>过时</strong>的浏览器，Amaze UI 暂不支持。 请 <a href="http://browsehappy.com/" target="_blank">升级浏览器</a>  以获得更好的体验！</p>
<![endif]-->

	<jsp:include page="/manage_header.do" flush="true" />

	<div class="am-cf admin-main">
		<!-- sidebar start -->
			<jsp:include page="/manage_tree.do" flush="true" ></jsp:include>
		<!-- sidebar end -->

		<!-- content start -->
		<div class="admin-content">

			<div class="am-cf am-padding">
				<div class="am-fl am-cf">
					<strong class="am-text-primary am-text-lg">工作项</strong> / <small>jobitem</small>
				</div>
			</div>
			<input type="hidden" name="id" id="id" value="${ jobitem.id}">
			<input type="hidden" name="page_num" id="page_num" value="0">
			<div class="am-tabs am-margin" data-am-tabs>
				<ul class="am-tabs-nav am-nav am-nav-tabs">
					<li class="am-active"><a href="#tab1">详细信息</a></li>
				</ul>

				<div class="am-tabs-bd">
					<div class="am-tab-panel am-fade am-in am-active" id="tab1">
					
						<div class="am-g am-margin-top">
							<div class="am-u-sm-3 am-u-md-3 am-u-lg-3">
								工种：${jobitem.jobtype.name}
							</div>
							<div class="am-u-sm-3 am-u-md-3 am-u-lg-3">
								施工面积：${jobitem.area}
									<c:if test="${jobitem.unit == 1}">平米</c:if> 
									<c:if test="${jobitem.unit == 2}">延米</c:if>
							</div>
							<div class="am-u-sm-3 am-u-md-3 am-u-lg-3">
								工资：<fmt:formatNumber value="${jobitem.salary}" type="currency"/>元/天
							</div>
							<div class="am-u-sm-3 am-u-md-3 am-u-lg-3">
								加急费：<c:if test="${jobitem.urgent_status == 0}">未加急</c:if> 
									   <c:if test="${jobitem.urgent_status == 1}"><fmt:formatNumber value="${jobitem.urgent_fee}" type="currency"/></c:if>
							</div>
						</div>
						
						<div class="am-g am-margin-top">
							<div class="am-u-sm-5 am-u-md-5 am-u-lg-5">
								开始时间：<c:if test="${jobitem.jobitem_status == 1}">
											<fmt:parseDate value="${jobitem.start_date}" var="start_date" pattern="yyyy-MM-dd HH:mm:ss"/>
											<fmt:formatDate value="${start_date}" pattern="yyyy-MM-dd HH:mm:ss"/>
										</c:if>
										 <c:if test="${jobitem.jobitem_status != 1}">未开始</c:if>
							</div>
							<div class="am-u-sm-4 am-u-md-4 am-u-lg-4">
								结束时间：<c:if test="${jobitem.jobitem_status == 2}">
											<fmt:parseDate value="${jobitem.end_date}" var="end_date" pattern="yyyy-MM-dd HH:mm:ss"/>
											<fmt:formatDate value="${end_date}" pattern="yyyy-MM-dd HH:mm:ss"/>
										</c:if>
										<c:if test="${jobitem.jobitem_status != 2}">未结束</c:if>
							</div>
							<div class="am-u-sm-3 am-u-md-3 am-u-lg-3">
								修改状态：
										<select id="status" name="status">
											<option value=0 <c:if test='${jobitem.status == 0}'>selected</c:if>>删除</option>
											<option value=1 <c:if test='${jobitem.status == 1}'>selected</c:if>>正常</option>
										</select>
							</div>
						</div>
						
					</div>
				</div>
			</div>
			
			<!-- 弹出框开始 -->
			<div class="am-modal am-modal-confirm" tabindex="-1" id="my-confirm">
			  <div class="am-modal-dialog">
			    <div class="am-modal-hd">好活儿</div>
			    <div class="am-modal-bd">
			     	 你，确定要改变这条记录状态吗？
			    </div>
			    <div class="am-modal-footer">
			      <span class="am-modal-btn" data-am-modal-cancel>取消</span>
			      <span class="am-modal-btn" data-am-modal-confirm>确定</span>
			    </div>
			  </div>
			</div>
			<!-- 弹出框结束 -->
			
			<div class="am-g">
				<div class="am-u-sm-12">
					<table id="data_table"
						class="am-table am-table-striped am-table-hover table-main">
						<thead>
							<tr>
								<th class="table-title" width="33%">接单人</th>
								<th class="table-title" width="33%">接单时间</th>
								<th class="table-title" width="33%">接单状态</th>
							</tr>
						</thead>
						<tbody id="data_tbody">
							<c:forEach var="jobitem_user" items="${jobitem_users}" varStatus="s">
								<tr class="tr_click" id="tr_${jobitem_user.id}" jobitem_user_id="${jobitem_user.id}">
									<td id="td_user_${jobitem_user.id}">${jobitem_user.user.name}</td>
									<td id="td_create_time_${jobitem_user.id}">
										<fmt:parseDate value="${jobitem_user.create_time}" var="create_time" pattern="yyyy-MM-dd HH:mm:ss"/>
										<fmt:formatDate value="${create_time}" pattern="yyyy-MM-dd HH:mm:ss"/>
									</td>
									<td id="td_jobitem_status_${jobitem_user.id}">
										<c:if test="${jobitem_user.jobitem_status == 0 }">等待</c:if>
										<c:if test="${jobitem_user.jobitem_status == 1 }">选中</c:if>
										<c:if test="${jobitem_user.jobitem_status == 2 }">落选</c:if>	
									</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
					<div class="am-cf">
						共<b id="pageCount"> ${page.allRow}</b> 条记录
						<div class="am-fr">
							<ul class="am-pagination">
								<c:choose>
									<c:when test="${page.currentPage==1}">
										<li class="am-disabled"><a href="#">«</a></li>
									</c:when>
									<c:when test="${page.currentPage!=1}">
										<li><a href="javascript:void(0)"
											onclick="choose_page(${page.currentPage-1})">«</a></li>
									</c:when>
								</c:choose>
								<c:forEach var="i" begin="1" end="${page.totalPage}" step="1">
									<c:choose>
										<c:when test="${page.currentPage==i}">
											<li class="am-active"><a href="javascript:void(0)"><c:out value="${i}" /></a></li>
										</c:when>
										<c:when test="${page.currentPage!=i}">
											<li><a href="javascript:void(0)" onclick="choose_page(${i})"><c:out value="${i}" /></a></li>
										</c:when>
									</c:choose>
								</c:forEach>
								<c:choose>
									<c:when test="${page.currentPage==page.totalPage}">
										<li class="am-disabled"><a href="#">»</a></li>
									</c:when>
									<c:when test="${page.currentPage!=page.totalPage}">
										<li><a href="javascript:void(0)" onclick="choose_page(${page.currentPage+1})">»</a></li>
									</c:when>
								</c:choose>
							</ul>
						</div>
					</div>
				</div>
			</div>
		</div>

		<!-- content end -->

	</div>

	<a href="#" class="am-show-sm-only admin-menu"
		data-am-offcanvas="{target: '#admin-offcanvas'}"> <span
		class="am-icon-btn am-icon-th-list"></span>
	</a>

	<jsp:include page="/manage_foot.do" flush="true" />
</body>
</html>

<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="assets/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<script src="assets/js/jquery.min.js"></script>
<!--<![endif]-->
<script src="assets/js/amazeui.min.js"></script>
<script src="assets/js/app.js"></script>
<script type="text/javascript">
$(function() {
	//修改工作状态
	$("#status").change(function(){
		$('#my-confirm').modal({
	        relatedTarget: this,
	        onConfirm: function(options) {
	        	$.ajax({
	    			contentType:"application/json",
	    			type : "GET",
	    			url : "<%=request.getContextPath()%>/update_jobitem_status.do?id="+$("#id").val()+"&status="+$("#status").val(),
	    			dataType: "json",
	    			success : function(data) {
	    				if(data.flag=="1"){				
	    		            alert("修改成功！");
	    		        }
	    		        else{
	    		            alert("修改失败！");
	    		        }
	    		    },
	    		    error :function(){
	    		        alert("网络连接出错！");
	    		    }
	        	});
	        },
	        // closeOnConfirm: false,
	        onCancel: function() {
	          if($("#status").val()==1){
	        	  $("#status").val(0);
	          }
	          if($("#status").val()==0){
	        	  $("#status").val(1);
	          }
	        }
	      });
	});
});
</script>